#被动技能【蓄能】
execute as @a[tag=qiaoyisi,scores={skIron_sword0=1..}] at @s run scoreboard players add @s skPlayer 5
scoreboard players reset @a[tag=qiaoyisi,scores={skIron_sword0=1..}] skIron_sword0
#被动技能【储能过载】
execute as @a[tag=qiaoyisi,scores={skIron_sword1=1..}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/0guozai

#主动技能【视界交换】
execute as @a[tag=qiaoyisi,scores={skEgg=1..}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/1cuansuo
#主动技能【视界交换】CD
execute as @a[tag=qiaoyisi,scores={skCDEgg=0}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/1cuansuo_cd


#主动技能【能源火球】
execute as @a[tag=qiaoyisi,scores={skSnowball=1..}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/2huoqiu
execute at @a[tag=qiaoyisi,scores={skSnowball=1..}] as @e[distance=0..4,type=snowball] run tag @s add huoqiu
execute at @a[tag=qiaoyisi,scores={skSnowball=1..}] as @e[distance=0..4,type=snowball] run data merge entity @s {NoGravity: 1b}

scoreboard players set @a[tag=qiaoyisi,scores={skSnowball=1..}] skSnowball 0

#主动技能【能源火球】触发效果
execute as @e[type=snowball,tag=huoqiu] at @s if entity @a[tag=!qiaoyisi,distance=0..3.5,gamemode=!spectator] run scoreboard players add @s skPlayer 1
execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run summon minecraft:fireball ~ ~ ~ {CustomName: '[{"text":" 能源火球 ","color":"dark_red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]', Motion: [0.0d, -1.0d, 0.0d], ExplosionPower: 2b}

#execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run summon minecraft:slime ~ ~-0.5 ~ {CustomName:'[{"text":" 能源火球 ","color":"dark_red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]',ActiveEffects:[{Id:14,Amplifier:0,Duration:600,ShowParticles:0b}],Silent:1b,Size:5,wasOnGround:1b,Attributes:[{Name:"generic.attack_damage",Base:6}]}

execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run particle minecraft:explosion ~ ~ ~ 0.7 1 0.7 1 7
execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run playsound minecraft:entity.generic.explode player @a ~ ~ ~ 3 0.7
execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run particle minecraft:lava ~ ~ ~ 1.5 2.5 1.5 0.1 15 normal @a
execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run particle minecraft:smoke ~ ~ ~ 0.1 1 0.1 0.1 50 normal @a
execute as @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}] at @s run particle minecraft:flame ~ ~ ~ 0.2 0.3 0.2 0.01 10 normal @a
kill @e[type=snowball,tag=huoqiu,scores={skPlayer=2..}]

#主动技能【能源火球】特效
execute at @e[type=snowball,tag=huoqiu] run particle minecraft:flame ~ ~ ~ 1 1.5 1 0.05 20 normal @a
execute at @e[type=snowball,tag=huoqiu] run particle minecraft:lava ~ ~ ~ 0.8 1.2 0.8 0.2 2 normal @a
execute as @e[type=snowball,tag=huoqiu,scores={skCDEntity=2..}] at @s run summon minecraft:fireball ~ ~ ~ {CustomName: '[{"text":" 能源火球 ","color":"dark_red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]', Motion: [0.0d, -2.0d, 0.0d], ExplosionPower: 2b}
kill @e[type=snowball,tag=huoqiu,scores={skCDEntity=2..}]

#主动技能【能源火球】CD
execute as @a[tag=qiaoyisi,scores={skCDPearl=0}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/2huoqiu_cd

#主动技能【视界锁定】
execute as @a[tag=qiaoyisi,scores={skEXBottle=1..}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/3huanshu
#主动技能【视界锁定】CD
execute as @a[tag=qiaoyisi,scores={skCDEXBottle=0}] at @s run function nw:yingxiong/2yingxiong/07qiaoyisi/skill/3huanshu_cd

#被动技能【能源储备】
execute as @a[tag=qiaoyisi,scores={skPlayer=..49,skCDPlayer=1}] run scoreboard players add @s skPlayer 2
execute as @a[tag=qiaoyisi,scores={skSneakTime=1..,skCDPlayer=1}] run scoreboard players add @s skPlayer 3
execute as @a[tag=qiaoyisi,scores={skPlayer=51..}] run scoreboard players set @s skPlayer 50
effect give @a[tag=qiaoyisi,scores={skPlayer=50}] speed 1 0 true
effect give @a[tag=qiaoyisi,scores={skPlayer=..0}] wither 1 2 true
effect give @a[tag=qiaoyisi,scores={skPlayer=..0}] weakness 1 0 true
effect give @a[tag=qiaoyisi,scores={skPlayer=..0}] slowness 1 0
effect give @a[tag=qiaoyisi,scores={skPlayer=..0}] mining_fatigue 1 1 true
scoreboard players reset @a[tag=qiaoyisi] skSneakTime
scoreboard players reset @a[tag=qiaoyisi,scores={skCDPlayer=1..}] skCDPlayer

execute as @a[tag=qiaoyisi] run title @s actionbar [{"text":"视界交换","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEgg","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 能源火球","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDPearl","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 视界锁定","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEXBottle","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 能源储备 ","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skPlayer","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"/","color":"dark_red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"50","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
